package com.yun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.pojo.Users;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper  extends BaseMapper<Users>{
    @Select("SELECT   NAME FROM  role  r  LEFT JOIN role_user ru ON r.`id`=ru.`rid` WHERE ru.`uid`=1")
    List<String> selectRole(Integer id);

     @Select("SELECT   permission  FROM menu m  LEFT JOIN role_menu rm ON m.`id` = rm.`mid`   LEFT JOIN `role_user`  ru ON ru.`rid`=rm.rid  WHERE ru.`uid`=1")
    List<String> selectMenu(Integer id);
}
